'use strict';

module.exports = app => {
    const mongoose = app.mongoose;
    const Schema = mongoose.Schema;
    
    const MessagesSchema = new Schema({
        userid:      { type: Number },
        messageId:   { 
            type: String,
            unique: true 
        },
        messageType: { type: String },
        messageTs:   { type: Number },
	    title:    { type: String },
	    content:  { type: String },        
        group:    { type: Number },
        replyId:  { type: String }
    });

    return mongoose.model('Messages', MessagesSchema, 'messages', { cache: false });
}